from public.tools import *
from public.action import *
from public.testDATE import *

from selenium.webdriver.common.keys import Keys
testCase="DBshop015_前台侧边设置"
MC="网站很好看"
firefox=openB(adminurl)
adminlogin(firefox)
menuu3(firefox,"商品管理","管理分类","前台侧边设置")
# "1.点击“添加侧边设置”按钮，显示名称“网站很好看”，排序255，点击“保存侧边显示信息”。
firefox.find_element_by_partial_link_text("添加侧边显示").click()
firefox.find_element_by_id("frontside_name").send_keys(MC)
firefox.find_element_by_id("frontside_sort").clear()
firefox.find_element_by_id("frontside_sort").send_keys(255)
firefox.find_element_by_xpath("//button").click()
# 2.保存成功信息"
s=firefox.find_element_by_xpath("//tr/td").text
print(s)
if s==MC:
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()